/**
 * unocss config
 * @author Chenyx by chenyx.site
 * @see https://unocss.dev/
 */
import {
  defineConfig,
  presetAttributify,
  presetIcons,
  presetTypography,
  presetWebFonts,
  presetWind4,
  transformerDirectives,
  transformerVariantGroup
} from 'unocss'
export default defineConfig({
  transformers: [transformerDirectives(), transformerVariantGroup()],
  presets: [
    presetWind4({
      preflights: {
        reset: true
      }
    }),
    presetAttributify(),
    presetIcons({
      scale: 1.2,
      cdn: 'https://esm.sh/'
    }),
    presetTypography(),
    presetWebFonts({
      provider: 'google',
      fonts: {
        sans: 'Roboto',
        mono: ['Fira Code', 'Fira Mono:400,700'],
        lobster: 'Lobster',
        lato: [
          {
            name: 'Lato',
            weights: ['400', '700'],
            italic: true
          },
          {
            name: 'sans-serif',
            provider: 'none'
          }
        ]
      }
    })
  ],
  theme: {
    colors: {
      // 亮色主题颜色
      background: 'oklch(100% 0 0deg)',
      foreground: 'oklch(14.5% 0 0deg)',
      card: 'oklch(100% 0 0deg)',
      'card-foreground': 'oklch(14.5% 0 0deg)',
      popover: 'oklch(100% 0 0deg)',
      'popover-foreground': 'oklch(14.5% 0 0deg)',
      primary: 'oklch(58.5% 0.233 277.117)',
      'primary-foreground': 'oklch(98.5% 0 0deg)',
      secondary: 'oklch(97% 0 0deg)',
      'secondary-foreground': 'oklch(20.5% 0 0deg)',
      muted: 'oklch(0.9671 0.0029 264.54)',
      'muted-foreground': 'oklch(55.6% 0 0deg)',
      accent: 'oklch(97% 0 0deg)',
      'accent-foreground': 'oklch(20.5% 0 0deg)',
      destructive: 'oklch(39.6% 0.141 25.723deg)',
      'destructive-foreground': 'oklch(63.7% 0.237 25.331deg)',
      border: 'oklch(92.2% 0 0deg)',
      input: 'oklch(92.2% 0 0deg)',
      ring: 'oklch(70.8% 0 0deg)',
      'chart-1': 'oklch(64.6% 0.222 41.116deg)',
      'chart-2': 'oklch(60% 0.118 184.704deg)',
      'chart-3': 'oklch(39.8% 0.07 227.392deg)',
      'chart-4': 'oklch(82.8% 0.189 84.429deg)',
      'chart-5': 'oklch(76.9% 0.188 70.08deg)',

      // 暗色主题颜色
      dark: {
        background: 'oklch(0.1974 0.0121 277.78)',
        foreground: 'oklch(96.8% 0.007 247.896)',
        card: 'oklch(14.5% 0 0deg)',
        'card-foreground': 'oklch(98.5% 0 0deg)',
        popover: 'oklch(0.2069 0.0098 285.51)',
        'popover-foreground': 'oklch(0.9197 0.004 286.32)',
        primary: 'oklch(58.5% 0.233 277.117)',
        'primary-foreground': 'oklch(98.5% 0 0deg)',
        secondary: 'oklch(97% 0 0deg)',
        'secondary-foreground': 'oklch(20.5% 0 0deg)',
        muted: 'oklch(27.9% 0.041 260.031)',
        'muted-foreground': 'oklch(70.8% 0 0deg)',
        accent: 'oklch(97% 0 0deg)',
        'accent-foreground': 'oklch(20.5% 0 0deg)',
        destructive: 'oklch(39.6% 0.141 25.723deg)',
        'destructive-foreground': 'oklch(63.7% 0.237 25.331deg)',
        border: 'oklch(92.2% 0 0deg)',
        input: 'oklch(92.2% 0 0deg)',
        ring: 'oklch(70.8% 0 0deg)',
        'chart-1': 'oklch(48.8% 0.243 264.376deg)',
        'chart-2': 'oklch(69.6% 0.17 162.48deg)',
        'chart-3': 'oklch(76.9% 0.188 70.08deg)',
        'chart-4': 'oklch(62.7% 0.265 303.9deg)',
        'chart-5': 'oklch(64.5% 0.246 16.439deg)'
      }
    }
  },
  shortcuts: {
    // 基础组件样式
    'icon-btn':
      'border-none bg-transparent flex cursor-pointer items-center justify-center relative z-10',
    // 背景颜色
    'bg-app': 'bg-background dark:bg-dark-background',
    'bg-card': 'bg-card dark:bg-dark-card',
    'bg-popover': 'bg-popover dark:bg-dark-popover',
    'bg-primary': 'bg-primary dark:bg-dark-primary',
    'bg-secondary': 'bg-secondary dark:bg-dark-secondary',
    'bg-muted': 'bg-muted dark:bg-dark-muted',
    'bg-accent': 'bg-accent dark:bg-dark-accent',
    'bg-destructive': 'bg-destructive dark:bg-dark-destructive',
    'bg-separator': 'bg-zinc-100/50 dark:bg-stone-500/50',
    // 文本颜色
    'text-app': 'text-foreground dark:text-dark-foreground',
    'text-card': 'text-card-foreground dark:text-dark-card-foreground',
    'text-popover-foreground': 'text-popover-foreground dark:text-dark-popover-foreground',
    'text-primary': 'text-primary dark:text-dark-primary',
    'text-primary-fg': 'text-primary-foreground dark:text-dark-primary-foreground',
    'text-secondary': 'text-secondary-foreground dark:text-dark-secondary-foreground',
    'text-muted': 'text-muted-foreground dark:text-dark-muted-foreground',
    'text-accent': 'text-accent-foreground dark:text-dark-accent-foreground',
    'text-destructive': 'text-destructive-foreground dark:text-dark-destructive-foreground',
    // 边框颜色
    'border-app': 'border-border dark:border-dark-border',
    'border-input': 'border-input dark:border-dark-input',
    'border-ring': 'ring-ring dark:ring-dark-ring',
    // 图表颜色
    'chart-1': 'text-chart-1 dark:text-dark-chart-1',
    'chart-2': 'text-chart-2 dark:text-dark-chart-2',
    'chart-3': 'text-chart-3 dark:text-dark-chart-3',
    'chart-4': 'text-chart-4 dark:text-dark-chart-4',
    'chart-5': 'text-chart-5 dark:text-dark-chart-5'
  }
})
